package Test;

import java.io.IOException;
import java.util.HashMap;

public class Demo3 extends Demo{

    HashMap<String,String> h = new HashMap<>();

    public Demo3(int p) throws IOException {
        super(p);
        h.put("小猫", "cat");
        h.put("小狗", "dog");
        h.put("小猪", "pig");
        h.put("荣耀战魂", "For Honor");
    }

    @Override
    public String respond(String s1) {
        return h.getOrDefault(s1,"该词条不存在");
    }

    public static void main(String[] args) throws IOException {
        Demo3 d = new Demo3(6633);
        d.start();
    }
}
